package com.zaydanwu.cla.controller.students;

import com.zaydanwu.cla.model.Credit;
import com.zaydanwu.cla.model.result.ApiResult;
import com.zaydanwu.cla.service.CreditService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @BelongsProject: cla
 * @BelongsPackage: com.zaydanwu.cla.controller.students
 * @Author: zaydanwu
 * @CreateTime: 2018-12-10 22:41
 * @Description:
 */
@RestController
@RequestMapping("/cla/api")
public class CreditCoontroller {

    @Resource
    private CreditService creditService;

    @RequestMapping("/getStudentCredit")
    public ApiResult<Credit> getStudentCredit(@RequestParam Long stuNo, @RequestParam String studentName) {
        Credit studentCredit = creditService.getStudentCredit(stuNo, studentName);
        return ApiResult.success(studentCredit);
    }
}
